﻿import { arrayBuffer, buffer } from 'stream/consumers';
import request from '/@/utils/request';
enum Api {
	AddOccupantAudit = '/api/occupantAudit/add',
	DeleteOccupantAudit = '/api/occupantAudit/delete',
	UpdateOccupantAudit = '/api/occupantAudit/update',
	PageOccupantAudit = '/api/occupantAudit/page',
	DetailOccupantAudit = '/api/occupantAudit/detail',
	GetOccById = '/api/occupantAudit/getOccById',
	UpdateOccStatus = '/api/occupantAudit/updateStatus',
	BindHouse = '/api/occupantAudit/bindHouse',
	UpdateEvery = '/api/occupantAudit/updateOccEvery',
	excelExport = '/api/occupantAudit/excel',
}

// 增加用户审核管理
export const addOccupantAudit = (params?: any) =>
	request({
		url: Api.AddOccupantAudit,
		method: 'post',
		data: params,
	});

// 删除用户审核管理
export const deleteOccupantAudit = (params?: any) =>
	request({
		url: Api.DeleteOccupantAudit,
		method: 'post',
		data: params,
	});

// 编辑用户审核管理
export const updateOccupantAudit = (params?: any) =>
	request({
		url: Api.UpdateOccupantAudit,
		method: 'post',
		data: params,
	});

// 分页查询用户审核管理
export const pageOccupantAudit = (params?: any) =>
	request({
		url: Api.PageOccupantAudit,
		method: 'post',
		data: params,
	});

// 详情用户审核管理
export const detailOccupantAudit = (id: any) =>
	request({
		url: Api.DetailOccupantAudit,
		method: 'get',
		data: { id },
	});

// 根据id查询用户审核管理
export const getOccById = (id: any) =>
	request({
		url: Api.GetOccById,
		method: 'get',
		data: { id },
	})
//修改状态
export const updateStatus = (params: any) =>
	request(
		{
			url: Api.UpdateOccStatus,
			method: 'post',
			data: params,
		}
	)
//绑定下拉框
export const BindHouse = () =>
	request({
		url: Api.BindHouse,
		method: 'get',
		data: {},
	})
//修改用户字段
export const updateOccEvery = (params: any) => {
	return request({
		url: Api.UpdateEvery,
		method: 'post',
		data: params,
	})
}
export const excelExport = (params: any) => {
	return request({
		url: Api.excelExport,
		method: 'post',
		data: params,
		responseType: 'arraybuffer'

	})
}

const userManageMent = {
	pageGetUserManage(parmas: any) {
		return request({
			url: "/api/occupantAudit/getUserManager",
			method: 'post',
			data: parmas
		})
	},
	getUserById(id: number) {
		return request({
			url: "/api/occupantAudit/getUserById",
			method: "get",
			data:{id}
		})
	},
	updateUserStatus(params: any) {
		return request(
			{
				url: "/api/occupantAudit/updateUserStatus",
				method: "post",
				data:params
			}
		)
	},
	getUserExcel(params: any) {
		return request(
			{
				url: "/api/occupantAudit/getUserExcel",
				method: "post",
				data:params
			}
		)
	}
}
export default userManageMent;


